<%inherit file="/mtp.html"/>

<h1>Viewing page <a href="${h.url_for('page', id=c.page.urlTitle())}">${c.page.title}</a> Revision: ${c.page_rev.revision}</h1>

% if c.diff:
    <h2>Diff from ${c.other_rev.revision} to ${c.page_rev.revision}</h2>

    <div class="diff">
    % for line in c.diff:
        <%
        code = line[:2]
        klass = {'+ ': 'diff_addition',
                 '- ': 'diff_removal',
                 '? ': 'diff_comment',
                }.get(code, '')
        %>
        <pre class="diff_line ${klass}">${line[2:].rstrip() | h}</pre><br/>      
    % endfor    
        
    </div>

% endif

<form action="${h.url_for('page_revision', page_id=c.page.urlTitle(), id=c.page_rev.revision)}">
    <label for="diffversion">Diff with version:</label>
    <input type="text" name="diffversion" size="4">
    <input type="submit" value="Show"/>
</form>

<h2>Original Content</h2>

<div class="wiki_content">
    ${c.page_rev.render()}
</div>

<h2>Raw Content</h2>

<pre>${c.page_rev.body | h}</pre>
